<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../css/auislide.css"/>
    <link rel="stylesheet" type="text/css" href="../css/play.css"/>
    <style type="text/css">
        html,
        body {
            background-color: #efefef;
            overflow: visible !important;
        }

        .aui-tabBar-fixed {
            position: fixed;
            bottom: 0;
            left: 0;
            z-index: 49;
        }

        .aui-class-list-title {
            padding: 5px 15px;
            background: #f2efee;
            width: 100%;
            position: relative;
            font-size: 0.7rem;
        }

        .aui-class-list-item {
            display: flex;
            -webkit-box-align: center;
            align-items: center;
            width: 30%;
            float: left;
            position: relative;
            z-index: 0;
            height: 60px;
            margin-left: 3%;
        }

        .aui-class-list-box {
            background: #fff;
            overflow: hidden;
        }

        .aui-cell-fl img {
            width: 25px;
            margin-right: 15px;
            display: block;
            border: none;
            border-radius: 3rem;
        }

        .aui-cell-fr {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            color: #fff;
            font-size: 0.6rem;
        }

        .wz {
            margin: 0 auto;
            width: 96%;
            font-size: 10px;
            background-color: #ffeb3c;
            border-radius: 0.1rem;
            height: 20px;
            margin-top: 10px;
            text-align: center;
            color: #4e4e4c;
        }

        .play {
            margin-top: 90%;
            background: linear-gradient(to right, #03bbf4 0, #d800ff 250%);
        }
    </style>
</head>

<body style="background-image:  url(../image/sy.png);background-repeat: no-repeat;background-size: 120px 40px;background-position: 50% 100%;">
<header class="aui-navBar aui-navBar-fixed"
        style="background: linear-gradient(to right,#03bbf4 0,#d800ff 250%);position: relative;padding-top:25px;"
        id="header">
    <a tapmode onclick="closeWin()" class="aui-navBar-item" tyle="color: #c4c4c4;">
        <i style="position: absolute;width: 12px;height: 12px;border: solid #fff;border-width: 1px 0 0 1px;transform: rotate(-45deg)!important;"></i>
    </a>
    <div class="aui-center">
        <span class="aui-center-title" id="title" style="color: #fff;">  正在播放 </span>
        <!--<img src="../image/d_02.png" style="width:25px;float:right;" onclick="browse()">-->
    </div>
</header>
<div class="play">
    <!--<img src="../image/d_04.png" style="width: 50px;height: 20px;position: absolute;float:  right;right: 10%;margin-top: -10px;">-->
    <a onclick="Fx()" class="aui-class-list-item">
        <div class="aui-cell-fl">
            <img src="../image/d_01.png" alt="">
        </div>
        <div class="aui-cell-fr">分享推荐</div>
    </a>
    <a onclick="/*browse()*/" class="aui-class-list-item">
        <!--<div class="aui-cell-fl">-->
        <!--<img src="../image/d_02.png" alt="">-->
        <!--</div>-->
        <!--<div class="aui-cell-fr">投屏</div>-->
    </a>
    <a id="play" onclick="jieXi()" class="aui-class-list-item">
        <div class="aui-cell-fl">
            <img src="../image/d_03.png" alt="">
        </div>
        <div class="aui-cell-fr">更换线路</div>
    </a>
</div>
<div class="gonggao" style=" border-radius: 0px 0px 30px 30px; box-shadow: 0.01rem 0.15rem 0.1rem rgba(0, 0, 0, 0.05);height: 1.3rem">
    <div class="list-title-l">
        <i class="" style="background: linear-gradient(to right,#1613d6, #181be6); -webkit-background-clip: text; color: transparent;font-size: 0.7rem">
            <b>全屏方法:</b>
        </i>
    </div>

    <div class="gonggao-r" style="float:right;width: 89%;position: absolute;text-align: center;right: 1rem;left: 3.8rem;width: auto;">
        <marquee scrollamount="5">
            <span id="gonggao" style="background: linear-gradient(to right, #00e7ff, #d800ff); -webkit-background-clip: text; color: red;font-size: 0.7rem;padding-top:0.3rem;">①:手机打开旋转功能，②:点击全屏按钮，③:手机横着就即可全屏</span>
        </marquee>
    </div>
</div>

<!--<div class="wz" style="padding-left: 5px">请勿相信影片中的水印广告</div>-->
<div style="padding: 20px;">
    <img id="bpic" style="border-radius: 25px;" src="../image/default_picture/mike.png" onClick="ompleted()">
</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/mike_no.js"></script>
<script type="text/javascript" src="../script/date.min.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.parseTapmode();
        var header = $api.byId('aui-header');
        $api.fixStatusBar(header);
        var headerPos = $api.offset(header);
        var body_h = $api.offset($api.dom('body')).h;
        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            // api.setScreenOrientation({
            //     orientation: 'portrait_up'
            // });
            api.closeWin();
        });

        api.setScreenOrientation({
            orientation: 'auto' //屏幕根据重力感应在横竖屏间自动切换 auto_portrait
        });

        var browser = api.require('webBrowser');
        browser.openView({
            url: api.pageParam.url,
            rect: {
                x: 0,
                y: $api.dom('header').offsetHeight,
                w: 'auto',
                h: 300,
            }
        }, function (ret, err) {
            switch (ret.state) {
                case 0:
                    break;
                case 1:
                    break;
                case 2:
                    break;
                case 3:
                    break;
                case 4:
                    break;
                default:
                    break;
            }
            ;
        });
        if (api.pageParam.needRecordHistory) {
            record_play_history();
        }

        //渲染广告
        getbpic()
    }
    function getbpic() {
        var api_url=localStorage.getItem('api_url');
        api.ajax({
            url: api_url + '/login/login/getbpic.html',
            method: 'get',
            data: {
                values: {
                    uid: localStorage.getItem('user_id'),
                    mike_key: localStorage.getItem('mike_key')
                }
            }
        }, function (ret, err) {
            if (ret) {
                //渲染图片广告
                var bpic = $api.byId('bpic');
                bpic.src = api_url+"/" + ret.msg.m112
                localStorage.setItem('m113',ret.msg.m113)
            }
        });
    }
    function ompleted() {
        api.openWin({
            name: 'h5',
            url: './h5.html',
            pageParam: {
                url: localStorage.getItem('m113')
            }
        });
    }


    //获取字幕
    // function getCaption(obj){
    //   var index=obj.lastIndexOf("\=");
    //   obj=obj.substring(index+1,obj.length);
    //   return obj;
    // }

    //关闭播放窗口
    function closeWin() {
        api.setScreenOrientation({
            orientation: 'portrait_up'
        });
        api.closeWin();
    }

    function jieXi() {
        api.actionSheet({
            title: '影视VIP线路',
            cancelTitle: '取消',
            buttons: ['VIP线路1', 'VIP线路2', 'VIP线路3', 'VIP线路4', 'VIP线路5', 'VIP线路6', 'VIP线路7', 'VIP线路8', 'VIP线路9']
        }, function (ret, err) {
            var index = ret.buttonIndex;
            if (ret.buttonIndex == 1) {
                vipHuanxian(localStorage.getItem('jx_url2'));
            }
            if (ret.buttonIndex == 2) {
                vipHuanxian(localStorage.getItem('jx_url3'));
            }
            if (ret.buttonIndex == 3) {
                vipHuanxian(localStorage.getItem('jx_url4'));
            }
            if (ret.buttonIndex == 4) {
                vipHuanxian(localStorage.getItem('jx_url5'));
            }
            if (ret.buttonIndex == 5) {
                vipHuanxian(localStorage.getItem('jx_url6'));
            }
            if (ret.buttonIndex == 6) {
                vipHuanxian(localStorage.getItem('jx_url7'));
            }
            if (ret.buttonIndex == 7) {
                vipHuanxian(localStorage.getItem('jx_url8'));
            }
            if (ret.buttonIndex == 8) {
                vipHuanxian(localStorage.getItem('jx_url9'));
            }
            if (ret.buttonIndex == 9) {
                vipHuanxian(localStorage.getItem('jx_url10'));
            }
        });
    }

    function vipHuanxian(jiekou) {
        api.hideProgress();
        var browser = api.require('webBrowser');
        browser.loadUrl({
            url: jiekou + api.pageParam.srcUrl
        });
    }

    function record_play_history() {
        //alert(api.pageParam.title);
        api.ajax({
            url: localStorage.getItem('api_url') + '/login/login/jilu?uid=3',
            data: {
                values: {
                    uid: localStorage.getItem('user_id'),
                    title: api.pageParam.title,
                    url: api.pageParam.srcUrl,
                    time: new Date().format('yyyy-MM-dd hh:mm:ss'),
                    ping: getPing(api.pageParam.srcUrl)
                }
            }
        }, function (ret, err) {
        });
    }

    function getPing(url) {
        if (url.indexOf("youku.com") > 0) {
            return '优酷';
        } else if (url.indexOf("iqiyi.com") > 0) {
            return '爱奇艺';
        } else if (url.indexOf("v.qq.com") > 0) {
            return "腾讯"
        } else if (url.indexOf("tv.sohu.com") > 0) {
            return "搜狐"
        } else if (url.indexOf("pptv.com") > 0) {
            return "PPTV"
        } else if (url.indexOf("mgtv.com") > 0) {
            return "芒果"
        } else if (url.indexOf("1905.com") > 0) {
            return "M1905"
        } else if (url.indexOf("baofeng.com") > 0) {
            return "暴风"
        } else if (url.indexOf("le.com") > 0) {
            return "乐视"
        } else if (url.indexOf("xxooweizhiurl.com") > 0) {
            return "未知"
        }

    }

    //分享推荐
    function Fx() {
        api.openWin({
            name: 'share_win',
            url: 'share_win.html',
        });
    }

    //投屏帮助 /////
    function Tp() {
        api.openWin({
            name: 'daili_guanli_win',
            url: './tp_win.html',
            delay: 100,
            pageParam: {
                url: localStorage.getItem('api_url') + '/tp/tp.png'
            },
            bgColor: 'rgba(0,0,0,0)'
        });
    }

    function TpPlay() {
        var LBAirDrop = api.require('LBAirDrop');
        LBAirDrop.searchList(function (ret) {
            alert(JSON.stringify(ret));
        });
    }
</script>

</html>
